Logic errors occur when a program compiles and runs but produces incorrect results due to flawed reasoning in the code. Unlike syntax errors, which prevent code from compiling, logic errors require careful debugging and testing to identify and correct, as they often stem from incorrect assumptions or flawed algorithms.