Sandymc47 has offered one possible explanation of a move from Inverness to Logie Buchan (though I would substitute the word 'Hanoverian' for 'English' and 'Jacobite' for 'Scottish' - there were many English in the Jacobite army and many Scots in the Hanoverian army at Culloden, so it wasn't a simple case of Scots v English)
Bonnie Prince Charlie arrived in Scotland on 23 July 1745, and he first went south, away from the Highlands, to Edinburgh and then into England. The battle of Culloden was on 16 April 1746, and it was in the aftermath of that that the Hanoverian army did most of its harrying of the Highlands. If William was born in 1745 in Aberdeenshire, the Jacobite rising would not have provided a reason for his parents' move. On the other hand, if he was born in the Inverness area, it might well have done.
However another possible explanation for a move is simply the availability of more fertile farmland and therefore of work. The mid-18th century was a time of innovation and advances in farming techniques, and the north-eastern corner of Scotland was one of the areas at the forefront of agricultural improvement. Many Highlanders moved south and east to work on the farms there.