Explaining Context Length Scaling and Bounds for Language Models