In Hinduism animal sacrifices and cannibals were very common. When Adi Shankaracharya made his debut, he replaced the inhumane rituals of animal sacrifice and nervous sacrifice with the tradition of offering coconuts to the gods instead.
The coconut plant resembles the human head in many ways. - The fiber on the outside is likened to the human head, its hardened crust or shell to the human skull, the water inside the body to the blood flowing to the human body, and the inner white layer to the inside of the head. Coconut is called "Sriphala" in Sanskrit. Sri fruit means fruit of God. So coconut is recognized as an essential fruit for God.
Breaking the coconut is the way to convey your ego and surrender to God. It is said that the knowledge that the coconut of ignorance and ego breaks down into the white part of it, is also seen as knowledge.