Apps from the same developer can share information such as login credentials between them. In your example of Gmail and Google Maps, they’re both Google-developed apps and such can share account information.
So is there a secure/hard restriction where only apps by the same author can share data?
Yes, at least on the phone itself. App developers are generally free to share freely with others from their own server platforms, as long as they stay within bounds of applicable privacy laws, etc.