Spermatozoa are generated from male primordial germ cells within the testes via spermatogenesis. This procedure incorporates mitotic and meiotic cell divisions, culminating in the production of fully developed sperm cells ready for ovum fertilization.