TL:DR - programmers use abstractions and "black boxes" all the time when coding, so to write something like SFML you do not need to understand every single level of a computer.
Well this is a really good question, but I think it boils down the concept of abstraction. It is impossible to know everything about computers, let alone the entire universe... But you live every day in a world you do not fully understand and are able to get along quite nicely. Think of food, you know when you eat food that it is going to nourish you and sustain your body - yet you do not really understand how exactly your body breaks that food down into energy or even how your body utilizes that energy. This is also called a "black-box", you know how to eat food, but not exactly how your body uses it.
Now the same concept of abstraction/"black box" is applied to computer programming. There is no way a single person could ever know everything about a computer and this is a good thing. This is exactly why if you want to work with computers you should focus on a specific area. If you want to know how the hardware works then you can play with bread boards all day long. But if you want to be a programmer then you focus on the software side and just take the hardware as a "black box" meaning you assume it will work. A quote that goes with this is "ignorance is bliss" meaning that not knowing something can actually help what you are doing. However it can go both ways, not knowing something could also possibly cause you to make a mistake - that is where APIs like SFML come in, they abstract away the concepts of lower level graphics programming so that it can be used as a "black box". The same goes for compilers, do you need to actually understand how a compiler converts C++ code to machine language to write code? In most cases you don't need to know how it does what it does, just how to utilize it and make it do its job.
Sure it helps to have a good overview of how a computer works at different levels, but having intimate knowledge of the protocol that is used to transfer data from the hard drive to the cpu isn't needed. The same goes for SFML, internally SFML uses OpenGL for rendering so a good knowledge of OpenGL is what is needed to write SFML. You don't really need to know how OpenGL is implemented in the driver and what the driver uses to talk to the video card, you just need to know how OpenGL works. This is true when it comes to the window management, all you need to know is the platform specific functions for managing a window and then you can write a window manager. You don't need to know how the window manager actually manages the windows internally, all you need to know that it works.
Long wall of text, but if you made it this far all you need to know is that computer programming is built on top of abstractions built on top of other abstractions to make life easier at every single level. And to anyone new to programming, for now focus on understanding the APIs that you are working with. Treat them as a "black box" and assume them to work properly as you learn to program and maybe later you can delve into what makes XYZ library do what it does.