How does a gender reveal party work?

In my country It's not common to host a gender reveal party, but I do like the idea of it. Although I have no idea how it Works. Do the parents-to-be organize the party for Friends and family to find out the gender. Or does your doctor sends the gender to Friends to surprise the parents?