Are specialised weightlifting shoes essential? And what about bare feet?

Many gym-goers wear trainers or sneakers, but some wear special weightlifting shoes with a built-up heel. And some may have no shoes at all. What is this witchcraft?