First of all, the obelisk.
This was originally placed by the Temple of Isis and Serapis, located in the area now occupied by the church.
It was found during the building of the church by the Dominican friars: Pope Alexander VII decided to place it in front of the church and he announced a contest to design the support of the obelisk.
One of the contestants was friar Domenico Paglia, one of the friars of the church and confratello of the Pope: he designed a base featuring the six hills of the coat of arms of the Chigi family (the family of Alexander VII), each corner guarded by a dog, symbol of the Dominican order (the preaching zeal against heresy of the Dominicans earned them the nickname "Hounds of God" ["Domini Canes"]), but the Pope refused this concept, as he wanted a monument to celebrate knowledge and wisdom as a tribute to the history of the place, not something to celebrate himself.
In the end the design of Gian Lorenzo Bernini was picked: the sculptor designed an elephant holding the obelisk on its back, and wrote on its basement "Sapientis Aegypti/ insculptas obelisco figuras/ ab elephanto/ belluarum fortissima/ gestari quisquis hic vides/ documentum intellige/ robustae mentis esse/ solidam sapientiam sustinere", which means something along the lines of "To those who notice the symbols of the Egyptian knowledge, held on the back of the elephant, the strongest animal: this is the proof that you need a strong mind to support a deep knowledge".
Bernini was inspired by a popular romance of the time, "Hypnerotomachia Poliphili" ("Poliphilo's Strife of Love in a Dream"), where the protagonist, at a certain point of the story, met an elephant holding an obelisk on its back.
Bernini proved that his project was more than stable, but in the end the Pope decided to support the opinion of the friar, so Bernini had to add a cube of cement under the tummy of the elephant that he tried to hide with by decorative caparison (sporting the coat of arms of the Chigi!), but the whole design was overall "overloaded", thus the locals nicknamed it the "piglet".
But Bernini knew how to get proper revenge.
He placed the statue in a position where this is what friar Domenico had to see whenever he had to get out of the convent, placed next to the church: