Not until Nathan defined the truth of the law to David did he understand his infraction. David then came to the knowledge of the truth.
Exodus 22:1-4
1 If a man shall steal an ox, or a sheep, and kill it, or sell it; he shall restore five oxen for an ox, and four sheep for a sheep.
2 If a thief be found breaking up, and be smitten that he die , there shall no blood be shed for him.
3 If the sun be risen upon him, there shall be blood shed for him; for he should make full restitution ; if he have nothing, then he shall be sold for his theft.
4 If the theft be certainly found in his hand alive, whether it be ox, or ass, or sheep; he shall restore double.
2 Samuel 12:1-7
1 And the LORD sent Nathan unto David. And he came unto him, and said unto him, There were two men in one city; the one rich, and the other poor.
2 The rich man had exceeding many flocks and herds:
3 But the poor man had nothing, save one little ewe lamb, which he had bought and nourished up: and it grew up together with him, and with his children; it did eat of his own meat, and drank of his own cup, and lay in his bosom, and was unto him as a daughter.
4 And there came a traveller unto the rich man, and he spared to take of his own flock and of his own herd, to dress for the wayfaring man that was come unto him; but took the poor man's lamb, and dressed it for the man that was come to him.
5 And David's anger was greatly kindled against the man; and he said to Nathan, As the LORD liveth, the man that hath done this thing shall surely die:
6 And he shall restore the lamb fourfold, because he did this thing, and because he had no pity.
7 And Nathan said to David, Thou art the man. Thus saith the LORD God of Israel, I anointed thee king over Israel, and I delivered thee out of the hand of Saul;
Hebrews 10:26 For if we sin wilfully after that we have received the knowledge of the truth, there remaineth no more sacrifice for sins,
"wilfully" is the key word to define a clear cut rebellion.