If I remember correctly, in Attack on Titan, it's mentioned or implied a number of times that humans built the walls to protect themselves from the titans. (Feel free to correct me if I'm wrong on this.) If so then, how did they manage to get the walls erected (which seem to be the result of somewhat extensive work) without getting killed, if they were already under attack by that point?
(Note: I'm only about halfway through the anime series, so I might just be missing something that appears later.)
The First King used his Coordinate power (control over titans) to force those titans to use their hardening power to shape up the walls, then used his Memory power to wipe the memories from the pre-wall era from humanity.
Why did he
leave hibernating titans inside the walls
he also created the Wallist Church to help him oversee the walls safety.
The Wall Titans (幻の巨人 Maboroshi no Kyojin?, Phantom Titans) are unusual kind of Titans that make up the Walls that protect humanity. They are first revealed when the Female Titan tried to climb Wall Sina to escape from Eren and the Survey Corps. The lack of sunlight inside the Walls renders them immobile.
It is implied that the Wall Titans have the ability of using their crystallizing powers to create massive walls, notably Wall Maria, Rose and Sina. Their exact motives for doing this are unknown.
This seems to imply something completely different to what I was thinking. Of course you can't trust everything you read, but I like to think this information is pretty accurate.
The walls are built by a special breed of titans that the colossal titan is and this is discovered when a piece of the wall is broken off
It is also stated here that a group of religious fanatics and the king know about the wall being made of titans.
Though the reason for the wall titans to protect humans is not stated it is possible that titan shifters made up the wall it is also possible that not all titans are against humanity considering the size of these titans they could have preyed on other titans thus providing a motive they wished to prey on titans and humans attract titans the humans might have trapped them and then the titans went into hibernation