PK Balachanddran explains all of this in an article for the Hindustan Times, contrasting the atheistic nature of Buddhism with the widespread prevalence of the worship of Hindu gods among Buddhists in Sri Lanka:
Buddhism is an atheistic religion, having no place for a God or Gods in it.
"For the common people the Hindu Gods are like a pair of crutches and a wall to lean on in case their legs and back are weak," said a Sinhala-Buddhist lady devotee at the Kali Amman kovil at Modera, in north Colombo. "Buddhist monks say that there is no harm in taking such help, if it can give some relief," the devotee said.
"Ordinary folk need help to solve their seemingly intractable personal, familial and social problems. But help is not accessible to them because of the stratified society. Perforce they have to appeal for divine intervention," the devotee added.
But they have to turn to Hindu Gods for divine intervention because the Buddha is not a giver of boons or a dispenser of favours. He does not even want to be worshipped. He will not accept any offerings other than flowers. The Buddhist sangha is not meant to render social and economic services to anybody including the hoi polloi. The Hindu Gods, on the other hand, are dispensers of boons whether it is wealth, artistic abilities, education, or power in return for worship.
Balachanddran quotes Dr WG Weeraratne, editor of the Buddhist Encyclopaedia, at some length:
The Buddha himself, never banned the worship of Hindu Gods or any God for that matter. "The Buddha himself had had conversations with the Gods as in the Sakkasamyutta and Vanasamyutta," points out Dr De Zoysa. To the Buddha, it did not matter if someone worshiped Gods so long it did not harm anybody or society, and so long as he followed the Dhamma, or the code of right living, adds Dr Weeraratne.
Buddha was not happy with the way the Brahmins were manipulating theistic ideas to suit their interests. "Through their control over religions practices, especially the sacrificial rites, the Brahmins were enhancing their social status and power at the expense of the masses. From the very inception, the Buddha considered this situation unsatisfactory. He felt that the theistic religion was enabling the Brahmins to exploit the people, through the caste system particularly," Dr Weeraratne said.
"The Buddha realized that the main cause of this phenomenon was the idea of the Creator God. He examined the concept of the Creator God and found that it had no basis. He rejected it. The Buddha also rejected all other Gods," Dr Weeraratne said.
"However, the Buddha did not debunk the popular belief in Gods and Goddesses, because they had taken deep roots in the minds of the common folk. He was aware that ordinary people did good things to get rewarded in their next life. They did not do bad things for fear of being punished in the next life. Therefore, the Buddha let this system of control remain. It did not matter to him so long as it played a positive social role," Dr Weeraratne explained.
"But the Buddha kept on discouraging the dependence on Gods in the running of one's life, pointing out that the Gods really would not be able to help or hinder anybody. For him Gods were but human beings who had attained divinity through good karma or deeds. They were not to be feared," Dr Weeraratna said.
According to Dr Weeraratne, there are three types of Gods in Buddhism: (1) Living human being to whom divinity is attached by popular acceptance like the Kings. These are called the Sammuti Devas (2) Human beings who become divinities after death because of their good deeds as human beings. These are called Upapatti Devas, (3) Those who have attained divinity through purification and righteous living as per the teaching of the Dhamma like the Pachcheka Buddhas and the Arahants ,the outstanding followers of the Buddha. These are the ones who have attained Nirvana and the freedom from the cycle of birth, death and rebirth. They are called the Visuddhi Devas.
Thus, even when Buddhists do believe in gods of some sort, those gods are not all-knowing (or even very intelligent), all-powerful, or all-present. No, they are just human beings who have achieved an important position in the universe due to their good deed while here on Earth. They aren't even "above" the Buddha in terms of knowledge or understanding. Being a god also isn't permanent - gods, too, are subject to "decay and death" over time.
Balachanddran quotes the late Buddhist activist Gamini Iriyagolle: "In Buddhism, the Gods are not supreme beings. They are subordinate to the Buddha and are there to protect the Dhamma." In describing the folk Buddhism in Sri Lanka, Balachanddran adds that this view of gods, this is taken a bit further and they are treated "as protectors of individuals facing the mundane problems of life."