All these guys hit it right on the nose. A well made, well maintained flintlock will practically never let you down. But there is a learning curve and you do have to pay attention.
Get a good lock from a reputable company. You get what you pay for. If you buy a factory gun instead of a custom or semi-custom, you can get high grade replacement locks for factory guns from L & R.
Use good flints and keep them sharp.
Keep your touch hole completely open (I pick it before every shot; same goes with your nose!
).
If hunting, don't be afraid to change your priming powder every half hour or so if it's a wet or humid day. If it's raining use a lock cover of some kind until you take your shot. Like everyone said, these things were in use for over 200 years. If they were truly unreliable someone would have changed them sooner. Good luck and enjoy!