I notice girls always cross their legs. I am curious how they all picked it up
Not all women cross their legs. The main reason why most of them do it is not only because it is comfortable to them but also because most of them were raised to know that not crossing them is unladylike, and that a proper lady always crosses their legs when they sit down.
Fun fact, in japan the manner of seating (as with most actions) is semi formalised.
The proper way to sit on a mat is called "seiza", on one's knees with the hands over one's thighs facing forward. The 'comfortable' position is called "agura" - men sit cross legged, whereas for women that's considered bad manners and instead both legs are folded to one side and laid flat in front across the pelvic region. Both genders had been wearing kimonos throughout history.
I'm led to believe the evolution of the socially acceptable sitting position is an intricate function of the nature of society itself and whichever garments they had worn, woven into norms which become rigid as time goes on without change, through observation & mimicry or direct commentary (by parents, friends).
Health wise, I was led to believe sitting cross legged is an additional strain on the blood flow & joints and should be avoided (for prolonged periods), yet without some preexisting condition it's more or less safe, as long as one avoids stasis (which I think can be more easily accomplished by securing a bit of extra space).