OOP concepts behind these formatting capabilities is probably beyond your capability to understand at this point in your programming education.
Simply need to memorize the format and syntax so that you can use these capabilities in programs that you write.