Why Facebook is buying Instagram.

Last week, mobile photo-sharing site Instagram raised $50 million from venture capitalists at a $500 million valuation. Today, the company agreed to be acquired for $1 billion by Facebook.

So what happened in the intervening days?

For starters, the venture capital round had been in the works for more than a month. In fact, the Wall Street Journal reported the deal back on March 9. But when the round finally closed last week, Instagram still was planning on building a large, independent company. Facebook had not yet made an offer.

How do I know? First, because people familiar with the situation have told me so. Second, and more importantly, there is no way Instagram raises that money if it has a $1 billion acquisition offer in hand. Remember, venture financings typically involve founder dilutions — and there is no reason to accept dilution if you’re just going to sell a few days later. And you certainly don’t accept dilution at a valuation that is just 50% of what Facebook is offering. If you need bridge financing, just ask existing shareholders. Or even your neighborhood bank (that Facebook offer would have served as pre-approval).

Instead, Facebook made its acquisition offer after Instagram closed the funding round. Not sure if that means last Thursday or over the long weekend, but it was within the past several days. More importantly, the timing may not have been coincidence.

Here’s how a couple different sources explain Facebook’s thinking: Last Tuesday, more than 1 million people download Instagram’s new Android app on its first day of availability. Facebook begins to get nervous that a social-sharing company like Instagram is able to migrate from iOS to Android so seamlessly. Then comes word that Instagram has raised $50 million in new funding from deep-pocketed investors like Sequoia Capital and Greylock Partners. In other words, Facebook may have a challenger.

“I think Facebook panicked,” says one observer. “So it decided to take out the competition before it had a chance to grow even bigger.”

And, unlike most other companies, Facebook has the resources and streamlined organizational structure to put together such a deal on short notice.

In other words, Instagram didn’t make a mistake accepting VC funding/dilution just days before agreeing to be acquired. Instead, it may be getting acquired, in part, because it accepted the new funding.

Sign up for Dan’s daily email newsletter on deals and deal-makers: GetTermSheet.com