CUBE is intended to provide interworking between systems and a trust boundary (eg between your network and the PSTN). It can also do a lot of things that CUCM cannot, registering a SIP Trunk to a provider as one example. There are free recordings from Cisco Live that spend hours explaining what the product offers.
https://www.ciscolive.com/global/on-demand-library/?search=Cube#/In some ideal scenarios CUBE isn’t technically required. For example, if you’re lucky enough that CUCM and another vendor’s PBX have *zero* interpretive differences of the various RFCs covering SIP, you might be able to build a trunk directly between them. Similarly, if your PSTN provider offers the SIP Trunk over your internal MPLS WAN, it *might* be possible to configure it directly on CUCM; even if it’s possibly you probably still want to use CUBE though with anything PSTN-facing.