It is rather formal and is often omitted, but it is used to avoid what you have created in your version of #2– a comparison between 'giving' and 'corporate foundations', which cannot logically be compared. The correct comparison is between 'their giving ' and '[ the giving of ] corporate foundations'. 'That of' = 'the giving of'.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.