Every bit that goes to the printer has to pass through the operating system to know how to handle the data, route it to the proper port and shake hands with the device before sending any data.
Most printers have either test pages or reports that are purely firmware based and can be initiated from the control panel or buttons on the printer even when the printer is not connected to anything other than power. These reports will show things like "supply status" (i.e. ink or toner levels), configuration (network settings if a network printer, memory amount, lifetime page print counts, etc), alignment checks (for inkjets), clean printheads (for inkjets), or just a general test page. Most of these types of tests/reports CAN also be initiated with the printer drive on a computer, but it is no necessary.
All four of my current printers can print tests/reports while not connected to anything other than power. This includes my roughly two decade old HP LaserJet 6MP laser printer. But it is true of both my newer LaserJet and both my inkjet printers (both are all-in-ones). For the old 6MP that does not have a display panel or any sort of menu structure, it is done purely by pushing combinations of the two buttons for the printer. For my other three printers, they have a display panels with a menu structure and a number of buttons to navigate the menu.