In the first sentence, “to” is part of an infinitive, which expresses finality. For example, if you lose your key, you may buy or manufacture a new one (in order) to be able to open a door.
In the second sentence, “to” is a preposition and the gerund stands for a noun. Thus the speaker could have also said: "Five keys to the creation of the new communications era". In particular, the expression the “key to something” means the only or at least best way to achieve something. This is a figurative use of the physical case: the key (= what gives you access to) a house.
Although the first expression is not grammatically incorrect, the intended meaning will be normally better expressed through the second one. With the latter, you are stating that if you want the propitiate the advent of the communications era (= enter a new room), you must do this and that (= use certain key actions). The first one is weird. Its meaning would depend on what precedes it. If, for example, I said “I am going to give you 5 keys to create a communications era”, I would somehow mean that the act of giving you such information is what causes the sociological change…, which is probably not the intention…
PS: the same applies to the expressions of the title:
"I am looking forward to attending the party" = I think of the future and see a picture of my attendance to the party, which is pleasant (I like the idea).
"I am looking forward to attend the party" = I look in front of me and trust that this way I will be transported to the party (you can... but don't expect to succeed, you had better take a bus...).
This example has the advantage of placing the two uses together, both with their respective meanings:
WHAT does your daughter object to? She objects to doing things that harm the world.
WHY does she object? She objects to those things (in order) to make the world a better place to live in.