Properly speaking, a buckle is a device for joining two straps. Very similar mechanisms that affix one object (other than a strap) to another are called clasps. There are a wide variety of buckles but they all have one thing in common: they are mechanisms with few moving parts that hold firmly yet can be released easily.
The most familiar buckles (the buckles on most belts) are called frame buckles. They consist of a (usually) square or rectangular frame one side of which is firmly attached to one end of one strap. Often the side of the frame that is firmly attached is a separate bar. This allows the frame to move freely during attachment and detachment. A metal prong is attached to the secured bar in the middle of the frame and this prong is fitted into a hole on the attaching strap to secure the buckle. Sometimes the frame is replaced by a solid plate and the prong becomes a small hook on the inner edge of the plate.
Military buckles (aka web belt buckles) consist of a hollow metal box that will accommodate a web belt through two windows in the box. There is a small pivoting strip with teeth that can make the box attach firmly to one end of the belt. When the other end of the belt is inserted through the windows in the box it can be locked in place by a pin that is permanently trapped in the box. The inner pin does not go through the belt--it is perpendicular to the belt and locks it in place because the inner frame of the box is cut so that when the pin is on one side of the box the belt tip can be inserted; but when the pin is slid to the other side of the box it pinches the belt so it does not slip. To release the belt it is only necessary to slide the pin to the other side of the box. The pin has rounded knobs at both ends that hold it in the box.
Seat Belt Buckles
Seat belt buckles have metal attachments on both ends of the belt. These attachments are called male and female because one attachment fits inside the other. Often, one end is not attached but allowed to slide through a loop in the belt, and sometimes one end of the belt is firmly mounted to something solid--as in automobiles. Other times seat belt buckles are on the ends of two straps--as in airplanes. The buckle is attached by simply forcing the male part into the female part. An extension or hole in the male part slips between two spring-activated plates in the female part and can only be released by pushing a button on the side of the buckle that pushes back the spring-activated plates.