Relational operators are used in programming to compare two values or expressions, returning a Boolean result of true or false. They are fundamental in controlling the flow of logic within a program, enabling decision-making through constructs like if-statements and loops.