Each programming language usually has its own pros and cons when it comes to how the programmer interacts with it. The differences usually boil down to differences in the syntax, and how the language “runs”.
For example Python general purpose programming language is easy to read, write, and is flexible with a huge number of packages supporting it. However, Python is ran in such a way that it is “interpreted”. So it will “read” the code its about to execute and nothing more, so if you have a bug somewhere deep within your codebase, you wont know about it until runtime.
This is in contrast with a language, such as Java, which is a “compiled” language, which requires a step where you take the code you write, compile it, and then run it. During the compile step, the Java compiler (another program) will read and optimize your code to run on the JVM (Java Virtual Machine), during this time it can also check for errors which can help you prevent bugs later at runtime.
For some historical context, XML was used as a data transfer before JSON became more popular, now JSON is the primary way of transferring data on the web. This was done because XML used more bytes to send the same information. Neither of these formats works for every case, something like loading an image or streaming video is done differently than using JSON or XML, such as streaming the raw bytes.
Finally, understanding that there are a bunch of ways to communicate between two pieces of code running in different places is one of the main concepts behind the internet in general. All these machines that make up the internet as we know it all need to communicate, and thus need to know how to. So there are these standardized formats that are used between each program. How the program is written and what its running on shouldn’t matter, as long as they follow the standardized protocols.