It's Walt's cell phone, which Hank tracks, that proves his undoing. He meets up with law enforcement in the desert where he went to retrieve his money that's buried in canisters. Hank arrests him and reads him his rights.
Finally, we bear witness to Walt's cowering in the car as a shoot-out takes place in the desert. His life, full of his deluded rationalizations, flashes before him. He tells himself he got into this whole mess because he wanted enough money to ensure the financial security of his family.
In the shoot-out the supposed good guys (who are really all too human guys with a big ego) could die. Walt could flee. It would be most interesting to observe in the remaining episodes what a free Walter would do next. My hunch is that he will recover nicely from this loss of his supreme confidence and try to pull off some more capers.