Our understanding of the atomic model has developed over time. The idea of the atom came from ancient Greece.
The ancient Greek philosopher Democritus believed that objects can be cut into smaller pieces, however, the smallest piece is uncuttable. So, he believed that all matter is made of tiny indivisible pieces of that type of matter.
Before the electron had been discovered, John Dalton believed that atoms are tiny solid balls that can not be divided into smaller components. This is the Dalton model.
Dalton believed that with a specific element, all atoms will be identical. And during chemical reactions, the atoms of the reactants rearrange to form new substances.
In 1897, J.J. Thomson discovered the electron. Therefore he proposed the idea that atoms have a positive charge with negatively charged electrons inside. This resembles a plum pudding, so it was called the plum pudding model.
As the electrons have a negative charge, it was assumed that the rest of the atom had a positive charge. Making the atom neutral overall. So, the atom is a ball of positive charge (the dough), with negatively charged electrons embedded in it (the plums).
Electrons were known to be smaller than atoms, so it was reasoned that they were somewhere inside the atom.