Depending the board I select under tools I see i.e. some sample sketches and others not. I.e. if I select the ESP8266 I see other sample sketches than if I select Arduino UNO. Where in the library can I say for which board the library will/shall work?
Each hardware package may bundle some libraries in its libraries subfolder. These libraries are only accessible when one of the boards of that package is selected from the Tools > Board menu.
You can also specify compatible architectures of libraries installed in the global libraries folder via the architectures property in library.properties:
These libraries will still be accessible no matter which board is selected from the Tools > Board menu but their examples will appear under File > Examples > INCOMPATIBLE and you will see a warning message displayed in the console when you try to compile a sketch that includes the library for any architecture not specified.