Each and every element in WPF inherits from DispatcherObject, and thus, the UI thread is always associated with System.Windows.Threading.Dispatcher. This is the reason why the Dispatcher object can be accessed any time by using the DispatcherObject.Dispatcher property.
ThreadPool.QueueUserWorkItem causes a delegate to execute on the CLRs thread pool. Thus, the operation performed within that delegate never executes on the UI thread.
Once the operation completes, and you need to update the UI, you must update this from the UI thread. The call to Dispatcher.BeginInvoke causes the delegate to run on the UI thread and make the necessary changes to the UI.
A point to note is that the dispatcher is also accessible from the UI thread, using the static property Dispatcher.CurrentDispatcher.