Red black trees are a subset of binary search trees that implement a coloring system for each node in the tree. Each node is colored red or black, and the tree must adhere to the following 4 rules:
Insertion and deletion operations have additional steps in a red-black tree to handle any red-black tree rule violations.
Nodes are inserted into a tree as red nodes by default, but changes to the tree may be necessary to ensure there are no red parent-child pairs.
Deletions can also cause a few different violations:
Here are some diagrams of insertion and deletion resolution processes:
For further reading, see this red-black tree guide