Here's why:
* Adjective: When used to describe a quantity, "four" modifies a noun.
* Example: "There are four cats in the house." (Describing the quantity of cats)
* Noun: When referring to the number itself, "four" acts as a noun.
* Example: "The number four is a lucky number for some people." (Refers to the number itself)
The part of speech depends on how the word is used in a sentence.