OpenLayers And GeoServer are two distinct softwares, used for different purposes.
Geoserver is a Server Software, which serves out Geospatial Data, via OGC services.
It just so happens, that when Geoserver wants to use something to display a preview, it uses a limited version of OpenLayers. Beyond this, they are totally independent.
You can use many clients with Geoserver like Leaflet, Qgis, ArcGIS Desktop & ArcGIS Web API's and many others.
Similarly, for OpenLayers, Geoserver is just one of the many possible sources of data. OpenLayers can use data from MapServer, GeoJSON files, GPX files, ArcGIS Server, and so on.
Now the answer to your question is, it depends.
If you just need to publish Geospatial data, and serve it via OGC services (like WMS, WFS & WCS) you can just figure out GeoServer, and forget about OpenLayers.
If on the other hand, you need to develope a web application that uses data from GeoServer, you'll need to learn a web mapping library like Leaflet, OpenLayer or many others.