They have the chemical elements, but they do not have a source of energy that could create life.

For the appearance of life, a planet with a hot interior and volcanism is necessary, so that minerals that are stable only at high temperatures in the interior are ejected to the surface, where after cooling down they are no longer in chemical equilibrium, providing the energy necessary to drive the synthesis of organic macromolecules (by producing through chemical reactions with water reduced compounds like dihydrogen and carbon monoxide, which can reduce the abundant carbon dioxide and dinitrogen to eventually generate amino-acids).

The solar energy cannot play any role in the appearance of life, because harvesting it requires systems that are much more complex than those that appear naturally in the inorganic minerals and fluids.

While the Earth had certainly all the preconditions for the appearance of life right here, it is likely that Mars also had them in the beginning.

What another poster has said is plausible, i.e. the only reason for supposing that life could have been brought on Earth from another place is that life has appeared rather quickly on Earth, even if this is an event with a much lower probability than all the other events that have occurred after that during the evolution towards more complex forms of life, which have required billions of years to happen.

If life has been transferred to Earth from elsewhere, Mars is the only plausible source, because it had the conditions necessary to generate life long enough before Earth and because fragments from Mars have been frequently transported to Earth, where they fall as meteorites, after being ejected from Mars by impacts that happened there, which is easier than from other planets due to the lower gravity.

Despite the fact that it is not impossible, I doubt that life has been brought from Mars, but it is indeed puzzling that life seems to have appeared very quickly on Earth.

There are also facts that are hard to explain by the hypothesis of transfer from Mars. If that happened, than the forms of life that have been transferred must have consisted of at least one kind of autotrophic "bacteria" and at least several distinct kinds of viruses, to explain all the existing living beings as their descendants.

There is considerable evidence for the fact that the current genetic code of the nucleic acids is the product of a long evolution process. In the beginning there must have been a simpler code where many more combinations were equivalent and which encoded no more than 10 amino-acids, perhaps only 6 or even only 4 in its original variant. So very ancient "bacteria" may have superficially looked like modern bacteria but they must have had a quite different metabolism. In the hypothesis where life has moved between planets, there would be an open problem of when had the transfer happened during this early evolution of the genetic system.

On Earth there has remained no survivor with a much simpler genetic code (though there are a few examples of only slightly simpler genetic codes than the canonic variant). Perhaps the earlier living beings were completely uncompetitive with the modern ones, so they have been eaten or they have starved to death. In the case of a transfer from Mars, it would also exist the possibility that only living beings with a complex genetic code had survived through a transfer and the others had remained on Mars.