Two countries can have a child together. They usually have to be neighboring each other though. Nations can also reproduce asexually (including males, even they don't know how it works). Sometimes their child just shows up on their doorstep, zero explanations, and they are magically genetically related. This one happens the majority of the time.
Something I found in an old sketchbook