Reasons why batch generates more than one query plan?
Each query in the batch needs a plan. And furthermore, each procedural function (scalar function or multi statement table valued function) in the batch needs a plan too, which is often less obvious.