Spot the Signs. According to Alison Green, who writes the blog Ask a Manager, this is common practice for some industries, especially if you're leaving to work for a direct competitor. However, in those situations, you'll likely know it's coming and can prepare accordingly.
However, at most companies, there's no formal requirement that you do so. Most employment in the United States is called "at will", which means that your current employer can fire you at any time and for any reason (except those that are prohibited under law).