Occlumency is a difficult art to learn. It is made more difficult because of the need of a Legimancer to learn. The best way to understand what happens is to think of the mind as a room with one "door". To protect your mind you have to close that "door". A master at the art can eventually create rooms within rooms within rooms. One can then hide secrets because only the occlumens would know how many "door"s to go through. The beginning of training requires clearing your mind while a legimens pushes on the natural. The person learning should feel the pressure of the "door" as the only thing in their cleared mind and locate where the entrance to their mind is. The "door" is completely natural and operates as a muscle. Once it is found the Legimancer continually applies pressure to it and strengthens it in the same way one would build muscle starting with softer pressure and increasing it over time until the door is strong. At that point the occlumens can leave the "door" open and second natural door will form and the process can be repeated. Some occlumens have thousands of weak doors. Some have 10 very strong ones. Masters like Severus Snape who operated as a spy actually had 10 relatively strong doors that the Dark Lord knew about and 5 virtually impenetrable ones that hid the fact that he was a spy.
"Legimens" Snape called as he once again attacked the mind of James Potter's spawn. He knew it was petty but he enjoyed the small revenge he could have against his nemesis through his son. The boy wasn't progressing as fast as he could but he was making progress. The slow pace was not the fault of the brat but was due to the fact that instead of knocking on the door, Severus Snape instead would pound on it. It was a cruel way to teach someone occlumency but not ineffective so Severus enjoyed his small revenge while not violating his oath to protect and teach the boy.
For the last year anger and desperation was the only thing that fueled Harry Potter. But beneath that was a deep and all-encompassing depression. He had been kept from the small connection to family he had, he had been denied access to his friends. They, Sirius and Dumbledoore had all left him to be alone and uncared for. And now his head was hurting under Snape's assault, his hand hurt because of the cruel detentions from his DADA teacher and most of his friends only cared about how much he could help them learn to defend themselves. In that moment the anger and desperation died under the realization that no one really cared about him and all that was left was the sadness and he gave up and allowed it to consume him.
Severus Snape saw the moment that the boy's eyes died. For the rest of his life he would never forget the moment those eyes, Lily's eyes, dimmed. He tried to pull back his banging on the week door to the boys mind but it was too late and he ran right through to the boys subconscious as Harry Potter completely gave up. The minute he touched it he was ejected from the boys mind and thrown across the room. When he got himself together and looked over to the boy, his entire being went cold and froze as he saw the spectral form of Lily Potter sitting on the floor holding the equally spectral form of Harry Potter.
