What does the phrase/idiom “au bon pain” mean?
I am translating it as “with the good bread” or “to the good bread”.
How has this idiomatic expression arrived?
This is not a specific idiom, it's just a rather frequent name for a bakery.
Lots of shop names will start with à, à is a preposition that here introduces the place one is at, as in:
Je suis à la maison (I'm at home).
Naming the bakery Au bon pain is a hint to potential customers that's the place where they'll be able to buy good bread. Naming the bakery Au bon pain puts the stress on the shop, the environment (the salespeople, the decoration etc...) , whereas Le bon pain (which can be found as well as a bakery name) puts more stress on the product.
In the same way in France you will find shop names such as:
À la bonne pêche for a fishmonger's.
À la bonne fourchette for a restaurant.
À la bonne bière for a café.
Au dé d'argent for a haberdashery.
You do not say in what context you have encountered the words so we can also imagine them used in a figurative context. For example I could say "chez nous c'est au bon pain", meaning that in my house we eat good bread. It still designates a place where good bread can be found.