Yes it has to do with the differences between block and inline elements but also block elements need a width before auto margins will work. Block elements can have dimensions applied but inline elements can't (elements with inline-block and and most replaced elements like images and buttons can also have a width applied but will not center with auto margins).
So to center a block element just give it a width and then use margin:0 auto (or just margin:auto although that won't reset the default top/bottom margins in some very old IE browsers).
For inline elements (and inline-block elements) you can just text-align:center on the parent and the text will be centred. If you use a left margin on an inline element then that margin only apples on the line that the text/element is on. If the line wraps there will be no margin on the subsequent lines.
Note that you can't use auto margins on floats as that makes no sense and has no effect.