I don’t know for certain but maybe start with the bl_preview_renders.py script that comes with each build (e.g. [bin]\2.90\scripts\modules\bl_previews_utils\bl_previews_render.py) This is typically used through the File->Data Previews->Batch Generate Previews menu entry for context.
It seems to use the
preview member on various data blocks (data blocks like scenes, objects, and collections) and attaches the rendered item there:
Poor docs: https://docs.blender.org/api/blender2.8/bpy.types.ID.html?highlight=preview#bpy.types.ID.preview
Example from script:
item = ... some datablock from bpy.data...
item.preview.image_size = (RENDER_PREVIEW_SIZE, RENDER_PREVIEW_SIZE)
item.preview.image_pixels_float[:] = image.pixels
I am not sure what datablock the file browser decides to use but the object and collection ones are probably used when going through the .blend during linking and appending. Perhaps just the scene is used for the main file browser?