Charities, fundraisers, and special events are very common and easy to promote, especially with social media. More often than not these events require things to give back to the people donating to the cause, or something to showcase. An easy thing to hand out? Cupcakes or slices of cake.
If you're running this sort of event and you're thinking of asking your local bakery/home baker to do something for it, think about what you're asking first.
1) Is it a a huge event with 100+ people, or something small for less than 50?
2) Will you reimburse them in any way, or is it tax deductible?
3) Can you make them yourself?
What sort of event are you planning/coordinating? Is it a run? Is it just a thing with booths everywhere? Is it being held in a tiny room in your local library? Depending on the event, any number of people can show up, and you can't always guarantee the outcome. You may think that it's going to draw hundreds of people, so you ask the baker to whip up 300 cupcakes (I say "whip up" sarcastically, because 300 cupcakes is no easy feat), but only 100 people show up. Sure, every person might eat 3 cupcakes, but what if there are other booths with food? What if not everyone likes desserts? No event has a set number of people attending, so there's no way to know how many people you will need to serve.
It could also go the other way: you're expecting 40 people to show up, but over 80 people show up. Well, now the baker only has enough to serve 50 or 60, and some people are left out. Not only does this look bad on the baker, but it makes you, the event planner/organizer, seem lacking in control.
When it comes to most charities or volunteer events, you, the organizer/coordinator, don't have all the funds in the world. It's a volunteer event, after all. Now you have to provide desserts, so you ask the local baker you have in mind to donate baked goods (and usually their time handing them out) for your event. Some times, if business has been good to them lately, and they really care about the cause, and they have time and ingredients to spare, they may say yes. Other times (most of the time), though, local bakers aren't in those sort of circumstances. Baking and caking aren't cushy jobs. Thank goodness the work is rewarding, otherwise why would people do it? Long hours, working most weekends and holidays, barely enough pay, and it's really messy work. So don't be surprised if they turn you down. Yes, it may be a wonderful cause, and it may make them feel good about themselves, but feeling good doesn't pay the bills. You may be inclined to tell them that it will get them a lot of exposure by presenting their product to people and getting their name out in the community, but you must realize that so will a paying job. Also, "exposure" is only useful if the community has to pay for the product because, let's get real here, a free cupcake is a free cupcake. They don't care where it comes from or who gave it to them, they just want to eat it and move on.
Some big programs will actually provide some sort of compensation, whether it be tax-deductible or straight up payment for the baker's services. Obviously the baker will be more inclined to help if that is the deal.
Now, I'm all for using local bakers for events because it stimulates the economy for your area, but if you're on a budget or you just don't have $400+ for 200 cupcakes, I'd say make them yourself. Yeah, 200 cupcakes is a lot, but if you're giving them away for free, don't spend all of your own money. A box of cake mix is $1.50, and it can make 24 cupcakes. A whole package of liners is probably $10, and some frosting is also $1.50. You'll spend approximately $35-$40, not including your time and gas/electricity for your oven. That's better than hundreds of dollars, plus when the cupcakes are free, most people won't care about the quality. If you don't have that sort of time, ask a friend to do it, another volunteer, or a family member. Trust me, mixing up, baking, and frosting 200 cupcakes is not a quick thing. You'll probably need to dedicate an entire day to it, if not, two.
Kudos to you for volunteering your time and effort for a good cause. Many people will be very grateful, and you can feel good that you made a difference in someone's life. Bakers are all for these sorts of events. They're not heartless or lacking in empathy. However, you must remember that you're asking them for a big favor by lending you their services, and most often they're already booked with paying orders, which will take priority over a non-paying gig. If you can pay them, that's wonderful. If not, don't be shocked when they say "no." Just move on and look for alternatives.