Baseball is declining for a number of reasons. The big factor is cultural: most Americans just don't have the attention span for it. IMO the NFL is similarly slow; I would say the difference between the two is that the NFL has marketed their product more effectively, and the public sees the big moments in the NFL as much more exciting. Baseball has also made huge efforts to clean up doping, which has led to a huge decrease in "big hitters."
The NFL has always been popular, no doubt. I would say improvements in TV technology and big marketing initiatives has driven it to another level. There's so much going on during an NFL play, which makes the sport perfect for new replay technology. It's also the perfect HDTV sport- watching big tackles is way cooler on a 55" big screen HDTV than it was on the TVs that most Americans owned even ten years ago.
I forgot to mention that fantasy football has done a LOT to lure in neutrals/keep the attention span of fans who support bad teams. Every week now has something on the line for a HUGE amount of Americans.