Why is the distinction between paid-in capital and retained earnings important?

Paid in Capital is the amount paid into the business by stockholders in exchange for shares of ownership. Retained earnings are earned capital held for future use in business. The distinction between the two is important from a legal and economic point of view.

My questions:

  1. What is the legal part of this equation?
  2. What might a company do that is illegal between the two accounts?