If you don't know where you are, guess a thousand times. The Particle Filter is an evolutionary algorithm where the most accurate guesses survive and multiply.
1The Cloud of Guesses
A Particle Filter represents the robot's position as a set of discrete Particles. Each particle is a 'Hypothesis'—it has a position (x, y) and an orientation (θ). At the start of a mission, if the robot is lost, we spread thousands of particles randomly across the map. This is called Global Localization. As the robot moves, every particle moves the same way. We are effectively simulating 1,000 different 'Parallel Worlds' to see which one matches reality.
2The Survival of the Fittest
When the robot's sensors see a landmark (like a wall 2 meters away), we Weight the particles. A particle that is 2 meters from a wall in its 'Parallel World' gets a high weight. A particle in the middle of an empty room gets a weight of zero. During the Resampling step, we randomly draw a new set of particles, but particles with high weights are much more likely to be picked (and cloned). Over several cycles, the cloud of particles 'Collapses' or Converges on the robot's true location.
3The Advantage of Diversity
Unlike Kalman Filters (which only track one 'Bell Curve'), Particle Filters are Non-Parametric. This means they can handle Multimodal Distributions. If a robot is in a building with two identical long hallways, the particles might form two distinct groups—one in each hallway. The robot effectively says, 'I am in either Hallway A or Hallway B.' Only when it sees a unique landmark (like a door) will one group of particles die out, allowing the robot to resolve the ambiguity. This robustness makes it the gold standard for indoor navigation.
