The literal meaning (something physical): A small opening in a wall.
The figurative meaning (an idea): an opening that allows a company or person to not follow a law or rule.
1. Loopholes in the tax laws allow large companies and wealthy individuals to pay less taxes than they should.
2. Loopholes in the law allow wealthy people to avoid going to jail when they hire highly knowledgeable and expensive lawyers.