The grid was a type of enormous force field created by Q in 2364 to seize the Federation starship USS Enterprise-D. The grid consisted of interlocking geometrical shapes and the Enterprise-D's sensors registered it as solid; Deanna Troi reckoned it to be "an incredibly powerful force field."
After Q appeared on the Enterprise's bridge, he threw up the same type of grid as the ship's security officers attempted to exit the turbolift.
When the Enterprise-D made an escape attempt from the grid, the grid shrank in size, coalescing into a bright spinning sphere. The grid, referred to throughout the chase as "the hostile", was faster than the Enterprise, achieving warp 9.9. After the saucer separation of the Enterprise-D, the stardrive section was enclosed by the grid. (TNG: "Encounter at Farpoint")
Q later used the same grid to stop the Enterprise-D, which was on an emergency mission to Quadra Sigma III. The grid was immediately recognized by Data as being "the "Q" Entity," noting how it was identical to the one encountered during the Farpoint Mission; Captain Picard later noted in his Captain's log that they had been "halted by an immense grid and an untimely visit from Q."
Later, when William T. Riker was given the power of the Q, he created a smaller version of this forcefield grid to stop the attacking "animal things" that had killed Worf and Wesley Crusher, before restoring their lives. Following their subsequent return to the Enterprise, Picard commented on Riker's actions, "that grid, their wounds. Only the Q can do that." (TNG: "Hide And Q")
While in the anti-time past, Picard ordered the crew of the Enterprise-D to proceed to Farpoint Station, despite Starfleet orders to report to the Neutral Zone, being the only one to recall events as they occurred in the normal timeline. As the vessel approached the region where the grid had appeared in Picard's memory, he was confused when it did not appear and shouted for Q. (TNG: "All Good Things...")