The Martians are eventually killed by earth-bound microorganisms, slain by "putrefactive and disease bacteria against which their systems were unprepared".
Despite their vast technological superiority over humankind, the Martians' lack of experience of life on planet Earth has meant that they've been unable to develop immunity to infections that would be harmless to humans, or at worst easily treated. The eventual fate of the Martians is foreshadowed in the book's first line, which states that they are as mortal as man. This tells us right away that they are not invincible; they are vulnerable; they can be killed. It's just that it takes the human race a long time to come up with a way to kill them.
Part of the problem seems to be an assumption on the part of so many that, because the Martians are so technologically advanced, it will take similar technological advances on the part of human beings if they are to be destroyed. Yet, in the end, all it took to repel the mighty invading army of aliens was some humble bacteria. By this stage of the book we should've realized that technology isn't necessarily all it's cracked up to be, a constant refrain throughout the works of H.G. Wells.