The question came up as to whether to roll your own implementation of something or to leverage something that already exists.
Say you need a backend, you are deciding between something like Firebase or building your own API.
Here's my rule of thumb, although rule of thumbs kind of suck.
They suck because you are likely an edge case, especially in startups. Edge cases are everywhere in engineering.
But generally, here's how I approach it.
Figure out if it's core to your application or critical IP. If so, I'd almost always opt for building in-house.
On the flipside, if it's a commodity, I have no problem using third party services. For instance, a commodity might be storage. There are tons of storage services out there.
Google, Microsoft, and Amazon have their own versions of it and you can swap them out as needed. You're not at the mercy of the company's proprietary system.
If you have an entire backend however, that's tied to Firebase or AWS, you're basically giving up control to these companies, and that seems bad.
Sometimes it's necessary though, especially if on a lean startup team. In this case I'd recommend looking for open source libraries if possible and deeply understanding the performance implications, technical debt, and architecture first before adopting such a system.