If offspring develop in adverse conditions, the maternal component of their phenotypic variation might increase due to the stronger dependence of offspring traits on parental investment. This should result in increased parental investment to individual offspring, as assumed by the model of optimal egg size. The opposite pattern, i.e., stronger dependence of offspring fitness on parental investment and consequently larger parental investment under good conditions is assumed by both the theory of differential allocation if attractive males provide material benefits, and reproductive compensation if they invest less into paternal care. Another influential idea is the Trivers-Willard model, which assumes sex-specific dependence of offspring fitness on parental investment. Here we tested these ideas by examining the effects of egg size on offspring fitness across many postnatal contexts in the Collared Flycatcher Ficedula albicollis. We employed a cross-fostering design that generated variation in egg size within nests and used brood means of fledgling mass as a functional measure of the quality of rearing conditions. Effects of egg size on three offspring traits, including lifetime reproductive success of recruits, were more pronounced in low-quality broods. These results support the assumption of the model of optimal egg size. Based on female preference for males providing material benefits, this pattern could support differential allocation, if attractive males invest less in paternal care, or reproductive compensation, if they invest more. By comparison, we did not find any evidence for sex specificity of fitness returns that might explain sex monomorphism of egg size in this species. The challenge for future studies will be the integration of components of parental investment and offspring fitness into their global measures and testing how the former affects the latter across gradients of postnatal conditions