The Five Ks are worn by Sikhs who have taken amrit, the initiation into the Khalsa, and they are not optional for those who have. Wearing them is the visible half of a commitment whose other half is a code of conduct.
Kesh, uncut hair, applies to all body hair and is the most demanding in practice because it is unending and unmistakable. Men keep it under a turban, retied fresh each day in a process that takes several minutes and is taught in childhood; the turban is not itself one of the five but is inseparable from the practice. Women may wear a turban or a scarf. Kangha, a small wooden comb kept in the hair, stands for order and cleanliness against the matted hair of the wandering renunciant, which makes it an argument about asceticism embedded in an object. Kara, a plain steel bangle on the wrist, is a restraint: a reminder at the moment of acting of whose one is. Kachera, a particular cut of undershorts, signals continence and readiness. Kirpan, a blade, carries the duty to defend those who cannot defend themselves.
The set was mandated by Guru Gobind Singh at the founding of the Khalsa in 1699, at a point when the community was under sustained persecution, and the visibility is the design rather than a side effect. A Sikh so marked cannot pass unnoticed and therefore cannot avoid being accountable for their conduct. That was the point when the identity carried lethal risk, and it remains the point in places where it now carries none.