The father determines the sex of the child. Women have two X chromosomes; Men have an X and a Y. Mothers can only give X chromosomes to their children through the egg; whereas fathers can give their children either an X or a Y chromosome through the sperm.
Men produce both X and Y sperm but have a tendency to produce more of one than another and this tendency is inherited.
Since Henrik fathered two sons, Joachim fathered two sons, and Frederik fathered one son with no daughters yet, it may be that Frederik and Joachim inherited a strong tendency from their father to produce Y chromosome sperm.
The men haven't fathered too many children and other factors can come into play so I may be wrong. Prince Claus of the Netherlands fathered 3 sons and no daughters but all his sons have only fathered daughters.