When you use a /fill command to replace both an item and the block it was placed on, the item will be dropped as an entity.