Cards with margins VS Edge to Edge container

Is there any logic behind when to use cards with margins in design VS edge to edge containers. I've gone through material design guidelines as well as iOS guidelines, which does not give any clear logic. Checked Facebook, which used to have cards with margin before, but has now switched to edge to edge containers. Could not find any research behind their decision to switch as well.

Card types for reference