There's no doubt that the traditional preference for a son in China is not as widespread and intense as it was 30, 20 or even 10 yrs ago. The 'One Child Policy' (计划生育政策jìhuà shēngyù zhèngcè), first applied in 1979, put pressure on rural households, where settling upon a male-free new generation, without a masculine assistance in the house and fields was a difficult task (but lucky for them, rural areas often received special permissions to exceed the one child limit). In the same time girl singletons often enjoy huge amounts of love, which daughters in the past had to share, sometimes unequally with their siblings.
Is there still preference for male offspring in modern China and who is in fact responsible for the continuity of this trend? The answer is certainly complex, but generally speaking such preference is still more common in rural villages, in which most families still desire at least one son. In the perspective of the broader family line, households usually wish that there are sons who continue the male lineage. That is to say, if the older of two brothers already has a son, then the younger brother and his spouse will have less pressure and need to produce a male offspring.
Sons of the male lineage are important, because of the traditional customs of a couple moving to live with the husband's parents in the same household, in which every generation is assumed to need masculine hands to cultivate fields, generate guanxi relations and make important decisions. Clearly, the picture is not as superficial as presented here, even in the country side, but traditional customs and beliefs are still prominent factors in family desires.
Still, nowadays in developing China there is quite a wide range of attitudes towards the preference for male descendants, even within the same geographical and socio-economic levels. What matters in a child's gender preference by parents isn't only the education and liberal versus traditional views, nor the actual pressure generated from other family members. Some studies have shown (particularly the ethnographic research mentioned in the bottom) that women who suffered from discrimination by parents who favored a so in the past, and lament their fortune, often instead of producing a different, more feminist attitude negating gender preference, actually preserve the traditional beliefs.
Like many parental behaviors which are preserved by the following generation even (and because!) the latter objects them severely, in a psychological effect which is common universally, in China, daughters who have experienced discrimination are so fearful that their own daughters will also suffer from such treatment to the extent that they actually prefer having a son. Furthermore, these women often desire to marry a boy which is not a singleton (preferably has a brother), and to avoid living in an environment which might consist of social pressures to produce boys.
Such women's motives are good - They wish to avoid a situation in which the extended family ‘needs' a son and might be thrifty with the loved expressed towards a new daughter, or even a situation in which the woman and her husband themselves are trapped in this traditional viewpoint. A son will not experience such pressure and therefore will live an easier life in such women's views. Furthermore, in families of more than one child, once a son is born then love could be express more freely towards the daughter.
It's is intriguing, yet understandable, that the women mentioned biggest nightmare is to have their daughters suffer just as they had in their own childhood (think about a Western gay man who prefers that his son will be straight and not experience a ‘problematic' childhood). What is more striking is the fact that these women sometimes fear that they will play a major part in discriminating daughters and favoring sons, just like their own parents and grandparents.
Such women often fear that social pressures cannot be overcome and fail to see that times have changed since their own childhood or that in today's China it is easier to resist and avoid gender-based discrimination. Evidently, even when intentions are good and an empathic attitude is expressed, ones traumatic experience can in fact become a major agent in preserving and extending an unwanted practice to future generations and reviving the trauma instead of acknowledging new opportunities.
Source: Evans, Harriet. 2008. The Subject of Gender: Daughters and Mothers in Urban China. Lanham: Rowman & Littlefield. Chapter 5: "Difference and Discrimination", pp. 125-44.