Goodwill is of two types:-
(i) Internally created – this is the value of goodwill that the promoter and board of directors think that the company has. This type of goodwill isn’t recorded in the books of accounts.
(ii) Goodwill created due to acquisition – This is the additional money that an acquirer pays to a company, above its fair book value, while acquiring it. This type of goodwill is recorded in the books of accounts because actual cash has decreased by that amount (payed to the person from which we brought the company).
Let’s understand this through an example.
Suppose a company A Ltd. wants to acquire another company B Ltd. B Ltd.’s balance sheet is updated by revaluating its assets to fair value. Pre-acquisition balance sheet of B Ltd is as follows:-

So the fair value of equity of B Ltd is 300. If A Ltd. finalises a deal to acquire it for 400, then the additional 100 that it paid will be for goodwill of company B Ltd. This goodwill paid will be shown in consolidated accounts of A Ltd. and not in standalone accounts of A Ltd. or accounts of B Ltd.

