Absalom was the son of Maacah (2 Sam 3:3), while Amnon was the son of Ahinoam (2 Sam 3:2), both by David, so they were half-brothers.
Tamar is said to be explicitly Absalom's sister (2 Sam 13:1, 32), in a way that Amnon recognizes she is not to him (2 Sam 13:4); yet she is viewed still as all the brothers' sister (1 Chr 3:9), as David calls Amnon her brother (2 Sam 13:7), both Amnon and Tamar recognizing a brother/sister relationship during the actual proposition (2 Sam 13:11-12), and Absalom recognizing and even emphasizes the brother/sister relation after the fact (2 Sam 13:20). These indicate a strong argument that she is truly Amnon's half-sister, not a step-sister.
Further, while the text never explicitly states she is David's daughter, most often being referred to with respect to her sister relations to the brothers, the text does obliquely state she is his true daughter through the wardrobe reference in 2 Sam 13:18 (NKJV):
Now she had on a robe of many colors, for the king’s virgin daughters
wore such apparel. And his servant put her out and bolted the door
While David clearly had no qualms about marrying women who's husbands were deceased (i.e., Abigail) and so could have acquired step-children through that, there is nothing in the text to indicate Tamar is such a child from a previous marriage/relation of Maacah (making her a half-sister to Absalom, and a pure step-sister to Amnon), and numerous strong hints that she is truly the daughter of David and Maacah, and so half-sister to Amnon.
Being a half-sister, Lev 18:9 and 11 applies. But did they know this and/or did they care?
David: expressed some ignorance of the law at least once before, in the manner in which the ark was to be transported, resulting in Uzzah's death (2 Sam 6:1-11). He also has evidenced disregard for the law at certain times himself, most notably in the case of adultery with Bathsheba and the arranged murder of her husband Uriah (2 Sam 11).* So it is possible that David is either ignorant or disregarding of some laws, perhaps including these. Perhaps more importantly, how well was he training his children in those laws, even if he was aware of them. Certainly some of his example was not instructive to them.
* This incident with Bathsheba almost immediately precedes the incident with Amnon/Tamar, which itself is undoubtedly part of God working to bring about David's punishment for the Bathsheba debacle, in that "the sword shall never depart from your house" and "I will raise up adversity against you from your own house" (parts of 2 Sam 12:10-11). Amnon/Tamar becomes the root cause in a series of rifts in the household (Amnon against Tamar, 2 Sam 13:16; Absalom against Amnon, 2 Sam 13:22-29; David angry with Amnon, but indecisive to act toward his firstborn, 2 Sam 13:21; etc.).
- Amnon: for him, it does not matter if he knew about the Levitical prohibition or not; he clearly lets his lust overrule any care for the Law or Tamar.
Tamar: may not be aware of those Levitical laws, especially if not taught well by her parents—David, was noted above and then Maacah was the daughter of the king of Gesher (2 Sam 3:3), which is a Canaanite people not driven out by Israel (Josh 13:11, 13). However, some points of the Law do seem to be known from Tamar's references.
Tamar's statement about the disgrace and shame in v.12-13 appears to relate more directly to rape itself:
- She is stating not to "force" her (v.12a), as that would be shameful to her (v.12c) chiefly because she was a virgin (v.18), not a harlot.
- She is stating "no such thing should be done in Israel" in respect to the "not forcing" her, i.e. rape, which could be a capital offence of the Law if she is betrothed (Dt 22:23-27) and at the least a lifetime decision if not (Dt 22:28-29). In this case I think the idea is more a disgrace of Israel because it occurs in the king's household. That is, her follow-up statement is Amnon "would be like one of the fools in Israel" (v.13b) if he did this, which implies others in Israel had done so, but it is a foolish way for him to go, and a shameful way for her.
- She makes a relative statement in v.16 that sending her away is "worse" than the what Amnon has already done. If this were in reference to Lev 18 violations, the statement actually does not make much sense. But in the context of Dt 22:28-29, it makes perfect sense, because in that passage, it is not the rape itself that is against the Law, but rather that if a man forces an unbetrothed woman, that he is to marry her and "he shall not be permitted to divorce her all his days." So the rape was foolish and shameful, but the sending away would be a direct violation of Dt 22:28-29.
The above analysis indicates some pattern that may be instructive to answer the question:
Should we expect the Mosaic laws on incest to have been observed
within the royal family at this time?
It seems that David and his household were more intimately aware of Deuteronomy than some of the other Pentateuch laws. Note these points:
- In 2 Samuel 6, David seems aware the Levites were to bare the ark (found in Dt 10:8, 31:9), but how that transport was to be done—with the poles by walking it—he appears to be ignorant of. Those specifics are in Exodus (Exo 25:13-16; 37:5) and Numbers (4:3, 15; 7:9).
The incest laws, in detail, are found only in Leviticus. In Deuteronomy 27:22, there is just this statement, part of the cursing Israel was to do on Mt. Gerizim (Dt 27:12):
Cursed is the one who lies with his sister, the daughter of his father or the daughter of his mother.
That would be enough to possibly add to the idea of foolishness and shamefulness for what Amnon was proposing, as it would bring a "curse" upon them, but it lacks the details of Leviticus and emphasis of Leviticus, being but one verse amidst a variety of other types of laws, and so may also have been missed in Tamar's knowledge.
- Tamar appears to be making reference to the rape laws of Deuteronomy by her statements, rather than the Levitical laws of incest.
- The law that the king was to copy the law is found in Deuteronomy 17:18, which could have been interpreted as being a copy of Deuteronomy, not the entirety of the other books. This would account for why he and his family may be more familiar with the laws relayed in there.
- Patriarchal history records near relation marriages/sexual relations, which were all banned by Lev 18: to daughter-in-law (Judah/Tamar, Gen 38:11ff.); to wife's sister (Jacob/Rachel, Gen 29:18); to aunt (Amram/Jochabed, Exo 6:20); to half-sister (Abraham/Sarah, Gen 20:12). So it could be a case of the narrative stories, particularly Genesis, being more influential than the Law that later banned such activities.
God clearly requires all His Law to be upheld by Israel, but whether king David and his household fully knew all that law is questionable, especially with respect to the incest issues. Nevertheless, I'm not sure one can be dogmatic about that ignorance, especially on David's part (perhaps more on Tamar's).
So if Tamar was in ignorance of those Levitical specifics, then there is no reason to assume her doubting David's approval for her to marry Amnon; though how sincere she was could still be very questionable on similar grounds to if she did know about the Law on this matter.
If she did in fact know the Law on incest, then her sincerity seems almost certainly unlikely. In that case, she probably appealed to the marriage idea as a way to "buy time" so that she could get out of the dangerous situation she was in and back to protection of the rest of the family (David and her brother Absalom). If so, she is lying about her belief of David's acceptance, considering that lie better than the consequences if Amnon follows through on his desires. This might also be grounds for why Amnon did not heed her voice (2 Sam 13:14), for he may have known that David would not give her to him, and so he determined it was now or never, and foolishly went for the now.
I am not sure one can be wholly dogmatic about Tamar's knowledge here. I lean from the evidence to believe that she may have been in ignorance of the specific Levitical incest laws, and was instead coming from a frame of reference related to her pagan mother, Patriarchal narrative examples, and the Deuteronomy laws of rape. Her statements appear sincere as far as that she believed David would have given her to Amnon and that after the fact, Amnon should have kept her as a wife rather than sending her away; whether she was repulsed by Amnon's initial advance other than the folly of it being an unmarried sexual relation for her as a virgin daughter of the king is hard to tell (i.e., that Amnon desired her may not have specifically repulsed her—Amnon was the firstborn, and assumed to be slated to be king). That Amnon forced her and then failed in his duty to her, she was clearly repulsed by.