Typically, efficient inference procedures in both frameworks rely on dynamic programming (e.g., Viterbi), which works well in sequential data.
in many important problems, the structure is more general, resulting in computationally intractable inference.