The phrase suggests that an action increases the chance of encountering problems. Not wearing a helmet while riding a bike is asking for trouble.
Pro Tip 2/3
Negative Outcome
It is used when an action is likely to lead to a negative or undesired result. Skipping class before the exam is asking for trouble.
Pro Tip 3/3
Hindsight Warning
Often used in hindsight to explain why certain actions led to predictable problems. He ignored all the warning signs, which was really asking for trouble.