It's a good question. Both frontend and backend can be any programming language and language doesn't matter for communication between them.
In order for communication to happen both frontend and backend first agree that we will use same communication protocol. Most commonly used one is HTTP. Think of http as nothing but a common letter writing format and the HTTP request/response format helps achieve that communication between the two.
Every programming language will have a http library through which it can support communication .
There are other communication protocols as well.
This one's a helpful article on http and understanding communication.
They don't communicate.
The backend spills out frontend.
Like playing cards, I have five cards on hand, I don't communicate with my cards, I just choose which one to play. I am the backend, the cards are the frontend.
Here is a list of resources
Each developer works his own editor or share the same with different accesibilities. For example a wordpress website has an administrator panel where authorized users have access and make changes and manage the site. Backend developers can write code in any editor and transfer it (as scripts) into admin panel. Frontends in sites rarely write code or write some lines of code only. They usually make changes by using the gui of the site administator page.
Check this link: