One of the biggest causes of grainy icing is not sifting the icing sugar. Sifting the icing sugar will ensure it is a fine powder which will then result in a lump, free and smooth final icing.