Why can't you walk through walls? The question looks like an easy one and the answer fairly straightforward. You are solid. Walls are solid. Therefore, unless you possess magical abilities (or are Kitty Pryde), running into a brick barrier at King's Cross, London, will give you a black eye and a sore head – not the way to board the Hogwarts Express.
But things get a little more complicated when you look at it on a microscopic level. We and everything else in the universe (including the barrier at King's Cross) are really just an assemblage of atoms and atoms are almost entirely empty space. To be pedantic, they are 99.99999 percent empty space.
This means that if you were to enlarge an atom to the size of a watermelon or football, the atom's electrons and nucleus would be too small to detect with the naked human eye.
So if this is the case, why can't you walk through walls? YouTube channel Life Noggin explains the science beautifully and succinctly in the below animation but, essentially, it comes down to a phenomenon called the Pauli Exclusion Principle. This says that no two fermions (a group of subatomic particles that includes electrons, protons, and neutrons) can be in the same state or same configuration at any one time.
When we imagine an atom, we might picture a neat diagram or model with a proton in the center and one or more electrons orbiting it in regular circles, much like the way a planet orbits the Sun. In reality, movements of electrons are far more haphazard, and while not directly comparable, they more resemble a shoal of fish than they do a planet.
“Electrons swarm around that empty space in cloud formations,” the narrator explains in the video, comparing them to blades on a fan. When you look at a stationary fan, there is a lot of empty space. Turn it on, however, and it's a different story. The blades move at such a speed that it is as if they are everywhere at the same time – the same is true for the electrons in an atom.
This means that if you were to walk through a wall, two electrons (yours and the wall's) would have to co-exist in the same space, albeit for a very, very short space of time. But, as per the Pauli Exclusion Principle, this is just not possible. Therefore, despite the fact that we are almost entirely empty space (a mind-boggling fact in itself), we cannot walk through walls – or any other solid material for that matter.