ATP is not an energy source, but an intermediate molecule that carries energy in the short term. For example, humans ultimately get their energy from the foods they eat. The body burns (i.e. oxidizes) these fuels in order to generate ATP, which then goes on to power various processes within the cell. Similarly, chemosynthetic bacteria oxidize inorganic substances and harness that energy to generate ATP.
As an analogy, people generally liken ATP to paper money and call ATP the energy "currency" of the cell. You ultimately earn money by producing material goods (i.e. by making a useful product like a chair or an app). You can then trade these goods for money, which can then be used as to pay for a number of other goods and services (whereas you normally would not be able to pay for your lunch with a chair). Similarly, cells "trade" the various food molecules (e.g. cabohydrates, fats, amino acids) into ATP molecules, and can use these ATP molecules to power a number of other cellular processes (so that these enzymes don't need to handle many different types of food molecules).