A shapefile is really a set of files and is awkward to share or load in a web page. GeoJSON puts the shapes and their attribute table in a single readable file that web maps and GitHub can display directly. The attributes in the .dbf file become feature properties.
Every format is read into plain GeoJSON features and written out from there, so coordinates, names and properties carry over wherever the target has a place for them. A zipped shapefile (the .shp with its .dbf and .shx) or a bare .shp is read. If a .prj file names the coordinate system, coordinates are converted to latitude and longitude; a coordinate system that cannot be read is refused. Coordinates are written longitude first, then latitude, as GeoJSON requires. Coordinates outside the latitude and longitude range are refused, since the file is probably in a projected coordinate system.