Understanding the legal basics of M&A transactions