When one company buys another and pays more than the fair value of the assets and liabilities it can name, the remainder is booked as goodwill. It is a residual of a transaction. It is not a measurement of a moat, and a business that was never purchased may have a strong position and no goodwill on its balance sheet at all.
Goodwill is not amortised on a fixed schedule under current IFRS and US GAAP. It is tested for impairment. A write-down says the buyer no longer expects the acquisition to support that carrying amount. It does not, by itself, say what the business can be sold for.
Goodwill inflates book value. Tangible book value takes it back out.