[an error occurred while processing this directive]
$Packages gives a list of the contexts corresponding to all packages which have been loaded in your current Mathematica session.
$Packages is updated when BeginPackage is executed.
$Packages is used by Needs to determine whether a particular package needs to be loaded explicitly.
See the Mathematica book: Section 2.6.9.
See also: Contexts, $ContextPath, DeclarePackage.