Shakespeare’s plays were performed by professional acting companies—most famously the Lord Chamberlain’s Men (later the King’s Men).
Women were barred from the public stage until 1660. All female roles—Juliet, Lady Macbeth, Cleopatra, Rosalind—were played by adolescent boys whose voices hadn’t broken and who were trained in “feminine” gesture.
This convention shaped the writing: Shakespeare crafted female roles knowing they’d be embodied by skilled youths, not women.