Bit of a frame shift, since we already know the Estonian particulars - this gear is older gear (towed 155s) Estonia's doctrine is de-emphasizing and replacing (with self-propelled 155s).
So, let's talk about Denmark, which is donating all of their 19 Caesar 155mm towed artillery, new and yet to be delivered equipment.
How can a NATO nation "donate all of its XYZs"?
First, let's consider the size of the nation in question.
A nation like Denmark, or Estonia, will be fighting within the NATO structure for any critical national emergency. By itself, it really can't do all that much against a large size adversary. Unlike say Greece, Denmark/Estonia also doesn't have to worry about a near-peer traditional adversary (Turkey) that NATO might sit out.
That means that their, temporary, capability gap can and will be plugged by other NATO members.
Germany donating all its artillery? Not so much.
Related, what's their EQ (Expeditionary Quotient)?
It is hard to envision Denmark or Estonia, with no ex-colonial ties sending their troops abroad on their own or within a small coalition (yes, yes, I know, Afghanistan). This would also be true of Germany. Contrast that with France, with its missions in the Sahel. Or the UK in Lybia. So that weapon class will not be needed by Danes or Estonians abroad.
What kind of weapons are involved?
Being heavy weapons, the Danish 155s are in a discrete spot in the Danish Army in 2020. The 1st Artillery Battalion (400-500 men sized unit), Danish Artillery Regiment, to be precise, within one of its brigades (4000 men sized unit). All of its gear. They are not an organic part of more numerous units. In other words, it's not like Danish infantry throughout the army is suddenly going to say "why did we donate all of our squad heavy machine guns?". Again, NATO trains constantly to integrate multinational units within the brigade level (which is all that up to now was going up in the Baltics).
The one drawback with the Danish donation seems to me that this now an artillery unit without even any guns to train with. This kinda sucks with artillery, it would definitely render an air force impotent for decades if all its fighter pilots ceased to have planes for 5 years.
Budget weight, ease of replacement, political will to replace.
Caesars are $8-10M so 19 of them aren't huge in Denmark's $4.9 military budget. They are still being built. And a big part of military procurement is deciding what to buy, which is typically a multi-year process. IF they re-buy Caesars, that easy enough to do. And since they donated all of them, they can be replaced with an equally coherent set of Caesars. Or another gun type.
In contrast, Challenger 2s aren't being built anymore (I think). Donating 14 out of 200+, UK will either do without or will have to buy 14 different MBTs to fill the gap.
Canada was more in the Denmark end of things with its park of 37 777s. They could have been replaced en bloc. And Canada could have been more generous.
But they donated only 4. An opportunity missed. Being Canadian, this is one reason I wrote this answer.
I assume Danish people will be fine with repurchases, but I am willing to bet the Estonian public won't be too critical on re-purchasing replacements.
Will they be needed in the short/medium term?
Last, but not least, NATO is largely oriented towards Russia, in Europe. Nuclear worries aside, Russia is currently about as unthreatening as it has ever been right on the Baltics/Danish end of things.
Not because Russia is a peaceful country, no. But because it has committed most of its best combat troops to the "special military operation" in Ukraine. They've suffered tremendous losses in men and equipment.
Even if Russians can't/don't see the benefit in voting out, or deposing, their warmongering government, the Russia bear will be licking its wounds for years to come, especially as a lot of the gear they have, and lost, is Soviet-vintage and their ability to build new stuff at scale is questionable. It will be a loooong time before they consider taking on NATO conventionally. Plenty of time to replenish those stocks.