In the 2nd sense, "take [someone, something] for granted" means to underestimate the value of that person or thing. In other words, to expect someone or something to be always available (such as to serve us without us needing to give recognition or thanks).