Understanding Finetuning for Factual Knowledge Extraction