Really, there is a little bit of both.
Of course, the basic framework of an effective constitution must already be embedded in the state. If you create a wonderful and democratic constitution and then impose it on an illiberal society, you will get nowhere. In order for a constitution to work, its basic ideas have to already be common in the society.
However, the state is also embedded in the constitution. A constitution can have a persuasive effect on the populace. For example, the idea of universal equality that is embedded within the US Constitution has not always been observed, but it remains as a powerful moral force that has tended to push us more and more towards providing equality for all citizens of whatever race, sex, religion, etc.
A constitution cannot remake an entire society, but it can help to nudge the society along towards the ideals embedded in the document.