To be clear, property that has been acquired during the marriage by gift or inheritance from a third party is non-marital property. However, the problem that often occurs is that the non-marital gift or inheritance becomes commingled with marital property so that it can no longer directly traced to the non-marital source. This is called commingling an asset. Once an asset is commingled it is very difficult to parse out any non-marital portion. A good rule of thumb to remember is that money looks the same no matter where it is held. If funds are all thrown together, it becomes impossible to tell which dollar is which.
For example, if a spouse inherits money from her parent, and deposits that money into a joint bank account with her spouse or deposits the funds into some other account (that account could even be an individually held account of hers) and also deposits her paycheck into that account as well, it becomes impossible to directly trace a specific dollar of the inherited money from a dollar of the marital funds. In that example, all of the funds in either account become marital funds due to commingling. In court, the spouse claiming that an asset is non-marital has the burden to prove (not just claim) that an asset has remained non-marital.
The reality is that most people don't live their married lives planning for a divorce. So if this is important to you, the best way to preserve the non-marital property is to negotiate, and enter into, a valid prenuptial or post-nuptial agreement to address these specific issues.