An obvious cause is a poorly fitting door or one with a faulty seal. If the door seal is not operating properly then it can allow warm moist air to enter the unit. This can then freeze forming a deposit at the back wall or on the shelves.
It may be that the seal is simply distorted and can be manipulated back into the correct position with a warm cloth. If it is too badly distorted, however, it will need to be replaced.
Another possible cause of frosting is if the fridge or freezer is not level. The cabinet may become twisted with the result that the door does not fit properly and the door not sealing as it should. This can lead to gaps which again allow warm moisture to enter.
Appliances can be simply corrected to make them level by adjusting the feet of the unit or slipping some cardboard under it.
I’ve a couple more points to make about door seals while I’m on topic. Firstly, always use the door handle to open a unit rather than curling your fingers around the seal to open it. The reason for this is that the seals split very easily this way.
So be careful with those seals!