Right from the very beginning girls are stronger than boys. Sperm that make girls are stronger than sperm that make boys.
Before it is born the baby is called a fetus. The fetus' basic features are female and things have to happen to turn into a male.
You've probably heard of genes. Well, big collections of genes are called chromosomes. The whole collection of chromosomes that go to make a girl is called XX. That's what happens easiest. The collection for boys is called XY. If an XX doesn't turn into an XY then the fetus stays a girl. If there's a failure it will be a failure to turn into a boy and it will look like a girl. Things have to actively happen to change the fetus into a boy.
And all the way along the line there are more male losses: there are more males that are born prematurely, or born smaller than they should be. Generally boys just don't do quite as well.
And, on the average, men die sooner than women. So that's why there are slightly more females than males.