The concept of piercing the corporate veil allows courts to look beyond a company's legal personality and hold its shareholders or directors accountable for their actions. This can occur in cases where a company is used as a facade to gain unfair advantages, or where criminal actions are involved. The court will pierce the corporate veil if it is established that individuals are using the company to benefit themselves rather than operate the business as intended.