The phrase in the pocket is used to describe something or someone playing in such a way that the groove is very solid and with a great feel. When a drummer keeps a good metronomic pulse, often referred to as keeping time, and makes the groove feel really good, and maintains this feel for an extended period of time, never wavering, this is often referred to as a deep pocket.
It's impossible to have a pocket without also having a groove.
Historically speaking, the term "pocket" originated in the middle of the last century with the occurrence of the backbeat, and implied that the backbeat, the Snare Drum striking the beats 2 and 4, is slightly delayed creating a "laid back" or "relaxed feel".
If the downbeat is exactly when the Kick Drum is struck, then the Snare Drum was very often played slightly later than the midpoint between two consecutive pulses from the Kick Drum. Musicians (and music listeners) were often times unaware of science behind this, but they had a term for it: "the drummer is playing in the pocket."
Today, the term "in the pocket" has broadened a bit, suggesting that if two musicians (usually the bass player and the drummer) are feeling the downbeats together, feeling and placing beat "one" at the exact same time, they are said to be "in the pocket."
Whether you are playing ahead (front) of the beat, or behind (back) of the beat, or right on top (middle) of the beat, as long as two musicians (ie. bassist and drummer) feel the downbeat at the same time, they'll be in the pocket.
Many people feel that the question is not so much what the pocket is as much as how you know when you've achieved it. To the musician, it feels like the music is playing itself, as though everything has merged together — all the rhythmic parts being played by one instrument.
Whichever definition you choose to go with or use, having a pocket is always good thing!