Yarn label questions

Hi. I have some questions on yarn labels. I have been knitting for some time now however I am confuses as to the label that is on the yarn. I tried researching but am not able to get an answer to my question. My concern is that I look at the label, and I see a 4x4 square with a certain knitting and crochet hook size and a certain gauge. What is the purpose of this?? Does it mean if I don't use the proper hook or needle size I shouldn't use the yarn?? I thought if a pattern calls for number 3-4- 5 and so on type of yarn i can just purchase that yarn and match gauge with my hook or needles. I'm confused sorry. I basically always thought you buy the type of yarn that is stated in the pattern then adjust gauge by the needle and hook so what is the reason for this diagram on the label, the 4x4 square with the specified hook and needle size??