The quote "Oh! What a tangled web we weave, when first we practice to deceive" refers to how complicated life becomes when people start lying. It originally referred to a love triangle in the play “Marmion” by Sir Walter Scott.
The line comes from Canto VI, XVII in the play. In the story, Lord Marmion is trying to win the favor of a lady. This lady was already involved with someone else, but Marmion decided to use his position to go forward anyway. He accused the lady’s suitor, Sir Wilton, of treason. Wilton has to then flee the country after a fight. Later on, Marmion dies in battle, and Wilton is able to come back and marry the lady.
The quote is often used to talk about the complex destructive effect that lying tends to have on life. When people start lying, they have to remember all the details of the lie rather than their true memory in order to keep the lie going when others ask about it. The quote also refers to the fact that lying often has unforeseen consequences. In the context of the play, the lie Marmion tells leads to the exile of his lady’s betrothed in addition to a fight that would not have happened if Marmion had just told the truth.