Necromancy is essentially using the dead (or at least the ‘spirits’ of them) to foretell future events. A necromancer is someone who is able to do this as required. The idea is likely pre-historical, arising from ancestor worship and funeral rites. Shamans, witch doctors and the like could have used hallucinogenic plants, fermented liquids or some foodstuffs to create an illusion of the dead being contacted and able to impart their wisdom.
Necromancy as a concept is found in the bible, in Ancient Greek and Roman texts. For medieval Christian Europe though, such action was heresy. Only God could raise from the dead and any ‘Spirits’ or even the raised body itself, that were summoned must therefore be demonic. Despite this the practice was still widespread. Ritualistic summoning was often what witches and heretics were accused of and the described rituals were. - to modern sensibilities - horrific, often using blood sacrifices. By this period, the practice was as much about raising a body as it was communicating with a spirit.
Today, most necromancy takes the form of mediums, conjouring spirit guides or seances. Though the Catholic Church accepts the idea of the dead living on and that sometimes the ‘souls’ of the dead manifest to the living, they deem necromancy or, as they put it the: “Science of evoking the dead [,...] is held by theologians to be due to the agency of evil spirits, for the means taken are inadequate to produce the expected results”.