Containers work best when the plant, pot size, sunlight, and watering reality all match each other.
Why some plants struggle in pots
Root space, moisture swings, heat buildup, and nutrient exhaustion happen faster in containers than in the ground.
Bottom line
The best container plants are usually the ones whose size and water needs actually fit the setup.