Living in a civilized land,
having made merit in the past,
directing oneself rightly:
This is the highest protection.
or
"To reside in a suitable locality, to have performed meritorious actions in the past, and to set oneself in the right direction — this is the highest blessing.
Patirūpadesavāso ca pubbe ca katapuññatā
Attasammāpaṇīdhi ca etaṃ maṅgalamuttamaṃ.
Patirūpadesavāso: resisting on a suiteable place, living in a land, sociaty, where right view is generally hold.
To Reside At A Favourable Place Is Bliss.
People whether they reside in a village, town or country, should always live amongst good and friendly neighbours, i.e. good and virtuous men.
If the people in a village are upright and strictly observe the precepts, then that place will be peaceful, safe and prosperous. Everybody in the village will always strive for each other’s welfare and any work will be peaceful and harmoniously conducted. Whereas, on the other hand, if the people of the village are unprincipled and corrupt, then sorrow and trouble will spring up naturally. There will always be quarrels and discontent, the strong ones will be aggressive to their weaker neighbours, and life and property will never be safe. Therefore we should always choose our surroundings before we decide to stay, because to reside among good and virtuous peoples is bliss.
Being born/living in a insuitable land/sociaty is one out the outwardly reasons why one can not flourish in Dhamma.
Having done merits in the past: being in a good existence, meaning human live, not stupid, good family and situation is effect of having done merits in the past. Having done merits means also that one has less debts, attachments and is merely free.
Also here, these effects of having done merits in the past are outwardly requirments for growing in Dhamma.
How ever, even if "having" merits, if not having set youself into the right direction, like a billionars son, one can lose all very fast. While one with less "wealth", if set out into the right direction, can only win.