Minecraft wiki entry for Diorite, associated text: Diorite rock comes from underground magma pockets that turned cold. Diorite usually has a salt & pepper appearance.
Andesite is diorite's above-ground equivalent: The two rocks come from the same kind of magma, but andesite forms in lava flows. Its fast cooling is what makes it look smoother than diorite.
Granite is another magma-pocket rock, but it's made of more quartz crystals. That would be why crafting diorite blocks with Nether quartz yields granite blocks.
Diorite is an extremely hard rock and is difficult to carve and work with.
In Minecraft: Story Mode, Reuben's grave on Episode 4 is made out of diorite and a new stair variant of it which cannot be found in Minecraft until the Village & Pillage update, which was announced roughly 3 years after Episode 4. It is unknown whether diorite slabs are present.