
You use functions to extract code that does a specific thing to encapsulate it. So when you want to do a specific thing at three different places in your program, you don’t need to write the same code three times but you call the function. It avoids redundancy and this is easier to maintain (only one place to fix stuff).
It’s decentralized, but federated. Email isn’t considered Fediverse either and I think it’s closer to xmpp. That said, I think both could become federated if other applications used their protocols and now that I think about it there’s at least a messenger using email protocol, so it probably is?