At its core, `tf.cond` orchestrates conditional execution within a static graph using `Switch` and `Merge` operations. `Switch` directs data flow to either a `true_fn` or `false_fn` based on a boolean `pred` tensor, while `Merge` combines the outputs from the selected branch. Both callable branches are traced into the graph, ensuring only one executes at runtime, but critically, they must return tensors with identical structures (number, dtype, shape).