The most secure form of fastening would be to sew a person into a garment, which is in most cases impractical. Short of this, a closure has to be easy to manipulate, strong but not stronger than the surrounding fabric, and aesthetically pleasing.
The earliest fasteners were pins, short lengths of bone, wood and metal. They were used by virtually all societies and are still required today. In time, they developed into simple brooches of which safety pins are the modern equivalent. Brooches gradually became more decorative until they ceased to have a primary function as fastenings.
The Development of Costume, Naomi Tarrant. National Museum of Scotland, Edinburgh, in conjunction with Routledge, London and New York. 1994.