Depending on your level of math ability you can often learn a lot by reading textbooks and proofs very carefully and closely (my opinion)
A supporting factor in the necessity of exercises for learning to actually do the math is that authors often hide important technical tricks in the exercises.
Of course, a sufficiently intelligent person could learn anything by reading tea leaves and then deriving on their own whatever it was they wanted to learn, so in a sense you can learn math by doing anything.
But everyone I know who is able to teach themselves math without lectures or a professor still does the exercises in the textbook. Math isn't a spectator sport, it's really important to do active learning.