The page style fancy (\ps@fancy) contains:
\@ifundefined{chapter}{...}{...}
That is the LaTeX test for undefined:
\def\@ifundefined#1{%
\expandafter\ifx\csname#1\endcsname\relax
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi}
\csname has the side effect that it defines an undefined command with the meaning \relax:
\show\chapter
\pagestyle{fancy}% \@ifundefined{chapter}{...}{...}
\show\chapter
The meaning of \chapter changes:
> \chapter=undefined.
l.3 \show\chapter
?
> \chapter=\relax.
l.5 \show\chapter
Now \chapter is defined for e-TeX's \ifcsname and \renewcommand{\chapter}{} is called that again used the LaTeX idea of undefined: A command is undefined if it is undefined or has the meaning of \relax. As result \renewcommand complains that `\chapter is not defined.
e-TeX's \ifcsname does not have the side effect and lets the command untouchted. (Also it is internally optimized in the sense that it does not create a hash table entry.)
The test needs to be a little longer:
\ifcsname chapter\endcsname
\ifx\chapter\relax
\else
\renewcommand\chapter{}
\fi
\fi
A defined \chapter might confuse packages and macros about the capabilities of the class (article does not have chapters). If the purpose of the mysterious \renewcommand\chapter{} is to undefine chapter, then it will fail, because \chapter remains defined with the meaning of an empty macro.
A command can be undefined by assigning it to an undefined macro:
\ifcsname chapter\endcsname
\let\chapter\UnDeFiNeD
\fi
\ifcsnamedoes not have this side-effect? I ask because I'd already used\ifcsname chapter\endcsnameat least once earlier in my original file. But there was never a complaint when compiling. – A.Ellett Jun 20 '13 at 06:47\renewcommand\chapter{}was just for the MWE. In the actual document I'm doing something more along the lines of what @egreg was suggesting regarding http://tex.stackexchange.com/a/111641/22413 an earlier question of mine). I would like my package to be versatile enough to define things correctly whether the class isarticle,book, etc. – A.Ellett Jun 20 '13 at 06:52