Phineas and Ferb were nothing but Candace´s imagination.
Phineas was a very smat kid , a “nerd”, he used to be bullied a lot at school, and one day the bullying got so bad , a kid at school punched him so badly it ended up killing him .
She couldn´t deal with Phinea´s death so she built an imaginary world where he was stil alive and playing with Ferb. Ferb was born with disabilities and as a result couldn´t talk or do much. She imagined both of the brothers going on adventures together and creating huge things in their backyard , and that´s why her mom couldn´t see them during anything because it was all in candace´s imagination.
Dr. Doofenshmirtz who is a vilan in the series is actually Candace´s psychologist, who she see´s twice a week.
What are your thoughts on this theory? let me know down below !