The getText function will usually return text content inside the HTML tag.
Eg.
<div>Hello World</div>
Here,
driver.findElement(By,tagName("div")).getText();
Will return the text "Hello World"
Usually if you are working with Textbox, the getText function will return null. The Textbox values are stored in "value" attribute. So, in that case you will have to use getAttribute("value");
Here is the example of typical text box.
<input value="submit" />
Using,
driver.findElement(By.tagName("input")).getAttribute("value");
will return the text "submit"
Hope that helps!