There are two main reasons why most tech startups incorporate in Delaware: they are incorporating as a C-corp, and they expect high growth.
As others have correctly stated, many people incorrectly assume that Delaware is the best state in which to incorporate when that’s often not the case. In reality, about one-half of all states have adopted the Model Business Corporation Act, making corporate law governing both public and private pretty uniform throughout the county.
While Delaware remains a notable exception, the trend is leaning towards more states adopting the Act, leaving little variation between most states. However, in addition to their state law being highly developed and favorable toward corporations, there tends to be a fairly universal knowledge of Delaware corporate law among lawyers across the country. At the same time, this is often because state corporate law – particularly the further west you go – is often patterned after Delaware corporate law. Many states enable you to incorporate online with the State Secretary of State’s Office in just a few minutes – and often for a lower fee than Delaware.
Filing as an LLC with subchapter S selection or some other type of entity that’s not a C-corp – especially when there’s no expectation of going public – is often best done in the state where the company is conducting business. Again, these are generalities and aren’t intended to provide specific legal advice or delve into the differences between the corporate laws of different states. I would again emphasize that very often the state in which the business is located is often the best state in which to incorporate.