The pagan nations surrounding Israel were polytheistic, i.e. they worshiped multiple gods. The most prominent gods worshiped were those believed to control fertility (human and agricultural) since their sustenance (via food) and continuance (via children) depended upon it. Two examples of pagan fertility gods with which Israel had contact were Ba'al (male) and Asherah (female).
Ancient, pagan fertility cult prostitution worked like this: A formal shrine/temple or informal 'high place' or 'sacred tree' was set apart as 'holy' by the pagan priesthood. To the place of worship people would bring offerings (food, wine and sometimes children). These gifts were brought in order to compel the fertility god or goddess to bless the land and wombs of the worshipers with fertility. It was believed that the fertility of the earthly land and human womb depended upon the sexual activity of the gods. The more sex Ba'al and Asherah enjoyed in heaven, for instance, the more rain would fall, the more productive the ground would be and the more fertile human wombs would be.
Consequently, pagan, fertility worship became bound up with encouraging the gods to 'get it on'. How to do that? So was born the belief that the gods were encouraged toward heavenly sexual activity by the corresponding earthly, human sexual activity between a worshiper and a priest/priestess/cultic prostitute. By the time of Hosea, pagan shrines were commonly equipped with a selection of young women or men who both received a worshiper's food/drink offering and made their bodies available for 'cultic sex' through which the worshiper could manipulate the gods to sexual activity which turned their fields/animals fertile as well as their wombs.
So, in simple fashion, cult prostitution followed the following process:
1. One's earthly fertility depended upon the gods' heavenly sexual activity.
2. The gods' sexual activity was generated by sexual activity with a cult prostitute.
3. Cult prostitution became a necessary part of creating a rich harvest and a full household.
Of course, such cult prostitution not only exploited young men and women, leaving a wake of emotional, physical and relational trauma, it degraded marital sexuality and mounted a frontal assault against the worship of God alone, which looked positively boring and restrictive in comparison. The devil always has his substitutes. They often taste tantalizing, but once swallowed their poison runs deep and deadly.