In the building and construction trades, anything that sticks out is male and anything that goes in is female--especially if two things fit together whereby one has features that stick out and the other has features that go in. If a tab fits into a slot, the tab is male, and the slot is female. The part of a plug that is inserted into another plug is male, and the plug it is inserted into is female. When two threaded pipes fit together, the one that is threaded on the outside is male, and the one that is threaded on the inside is female.
The pipes to be joined both have a spiral grove cut around an inch or so of the end of the pipe. The smaller pipe (the male) has the grove cut around the outside of the pipe. The larger pipe (the female) has the groove cut around the inside of the pipe. When the male pipe is inserted into the female pipe and turned, the grooves align and the pipes screw together and form a solid connection. For this to happen the taper (threads per inch) must match--the grooves must spiral at the same angle.
There are several industry standards for pipe threading. The most common pipe thread standard is the National Pipe Thread (NPT)--intended for pipes (not hoses) that carry liquids, For pipes that do not carry liquids there is the National Standard Free-Fitting Straight Mechanical Pipe Thread (NPSM). Garden hoses and fire hoses also have their own standards, GHT and NST respectively.
The benefit of threaded pipe is that a very solid connection can be made without using a special coupling device. Most threaded connections hold the liquids being transported--especially if low pressures are involved and the flow of liquid is in the male-female direction.
Threaded pipes do not connect perfectly. There is always a little room between the crest and the roots of the threads--otherwise the pipes could not be screwed together. For high pressure liquid transport, there will be leakage with just threaded connections.
There is a tape (called pipe thread tape) that can be wound around the male pipe before it is inserted into the female. This tape should be wound around the male pipe in the direction that will tighten it when the pipes are joined. The tape not only prevents leakage, but it makes it easier to unscrew the pipes in the future. Threaded pipes (without the tape) tend to get stuck together and are hard to separate at a later date.