Oil shale in the strictest sense is a sedimentary rock with a mixture of organic matter and mineral matrix that is not yet thermally mature.
Organic-rich sedimentary rock covers a lot of ground. Most sediments don't have significant organic matter because it was not present in the first place, was oxidized, or was consumed by burrowing infauna. Those sediments that preserve significant organic matter (more than a % or so) range from oil shale or carbonaceous shale (from aquatic single celled or terrestrial plants, respectively, with dominant mineral matrix) to kukersites / torbanites or coal (lacking mineral matrix). Organic matter deposition requires an environment with a combination of high organic productivity and low inorganic deposition, like swamps or anoxic (oxygen deficient) lakes and seafloor far from sediment sources like rivers or turbidites. The mineral contribution can be organic calcite (such as coccoliths) and silica (diatoms), or inorganic chemical (calciie, chert, evaporites) and detrital (silt and clay). All typically very fine grained, but composition varying based again on the depositional environment. Once deposited, the organic-rich sedimentary rock undergoes further changes through diagenesis - compaction and dewatering; changes in mineral composition and texture; thermal conversion of the organic matter to solid (coally), liquid (oil) and gaseous (natural gas) phases which may migrate away.