It’s very limited, by design. Gary Gygax was very concerned with gameplay balance (even if his method of balancing may seem a bit strange by today’s standards), and he created a spellcasting mechanic inspired by Jack Vance’s novels specifically in order to limit the potential versatility that magic could grant to a character. Sure, magic can do anything, but you need to know the right spell, to have the power to cast it, and to have the foresight to prepare it in advance, and you could only do this so many times per day. Otherwise, he reasoned, it would be impossible to challenge a magic-using character.