KML is Google Earth and Google My Maps' native export format, but most modern web mapping libraries (Leaflet, Mapbox GL, MapLibre, most GIS web stacks) expect GeoJSON instead. This parses placemarks, paths, and polygons out of the KML and re-encodes their coordinates and metadata as standard GeoJSON features, ready to drop straight into a map.
Google's format versus the web's format
KML came out of Google Earth and carries a lot more than geometry. A placemark can have a custom icon, a line can have a colour and width, a folder can group features, and a balloon can hold formatted HTML that appears when you click. It is a presentation format as much as a data one.
GeoJSON is deliberately narrower: geometry plus arbitrary properties, and nothing about how any of it should look. Converting therefore keeps the shapes and the attached data while dropping the styling, on the reasonable assumption that whatever renders the GeoJSON, Leaflet, Mapbox, QGIS or a Python notebook, will apply its own.
The coordinate order that catches everyone
GeoJSON specifies coordinates as longitude first, then latitude. This trips people up constantly, because most of us say and write coordinates the other way around, and because a great deal of mapping software accepts latitude first. Get it backwards and your points do not error, they just appear somewhere implausible, often in the ocean off West Africa where the axes cross at zero.
KML uses the same longitude-first order, so a straight conversion preserves it correctly. The mistake usually enters later, when someone hand-edits a coordinate or joins the data to a spreadsheet that stored the pair the human way round. If your features land in the wrong hemisphere, that swap is the first thing to check.